using System.Web.UI;

using QuickDev.Localization;

[assembly: TagPrefix("QuickDev.ServerControls", "QuickDev")]
namespace QuickDev.ServerControls
{
    [ToolboxData( "<{0}:HelpLink ID=\"HelpLinkId\" runat=\"server\" />" )]
    public class HelpLink : System.Web.UI.WebControls.HyperLink
    {

        protected override void Render( HtmlTextWriter writer )
        {
            if ( !string.IsNullOrEmpty( this.ID ) && this.Text.Length == 0 )
            {
                string helpText = string.IsNullOrEmpty( LocalizationUtility.GetHelpText( this.ID ) ) ? LocalizationUtility.GetHelpText( "noHelp" ) : LocalizationUtility.GetHelpText( this.ID );
                this.Attributes.Add( "onmouseover" , string.Format( Overlib.TOOLTIP , helpText ) );
                this.Attributes.Add( "onmouseout" , Overlib.MOUSEOUT );
            }
            base.Render( writer );
        }
    }
}
